Jasper framework

The Jasper framework is an open source, cross platform web development framework. It is often simply referred to as Jasper.

Contents

Preliminary definitions

Because Jasper supports several languages and platforms, some definitions are helpful in understanding its description. In Jasper parlance, a web interface provides the functionality to enable code running on a web server to be both referenced by a web client (usually a browser) via a URL, and to communicate its response. Common web interfaces are the CGI interface, Sun's Java servlets model and Microsoft's ASP.NET framework. The last example in fact encompasses far more than a web interface, but this functionality is virtually all that the Jasper framework requires. A web platform is defined as a combination of programming language and web interface. C#/ASP.NET, for example, or Perl/CGI. A web framework is defined as a system that enables the generation of dynamic web content. In this sense, the Jasper framework is a web framework but not a web platform.

Description

Jasper currently supports (or can be said to be supported by) four web platforms. They are:

Such is Jasper's generality that it could support many other web platforms.

In essence, Jasper is a template engine. It works by replacing instances of tokens with the appropriate content both in plain text template files, usually HTML files, and list files. The latter are used primarily to generate query strings, the part of URLs occurring after the question mark. To this end, Jasper employs five template classes to process template and list files, organised in a template class hierarchy that can be easily extended to process custom tokens. Tokens processed by default consist of those whose contents match the names of form variables, configuration variables, or temporary variables, in each case the token is replaced with the associated value of the variable in question. These three types of variables are stored in an associative array, called the global properties array. Form and configuration variables are added to this array at inception by methods of the Form and Config classes which, together with the template classes, comprise Jasper's core. Temporary variables are so named because they are added to the global properties array directly in the code, and are removed immediately they are no longer needed, to keep the size of this array to a minimum.

A mathematical basis

Such is Jasper's simplicity (its core classes are typically implemented with only a few dozen lines of code regardless of platform) that its workings can be completely described by Hoare logic with only minimal extensions. The global properties array provides the state of the web application from its inception to the communication of its generated content and its subsequent destruction. By this means, both the workings of the web application during the course of a single HTTP response, and the progression of the state of the web application during a session of several pairs of requests and responses (for example, which page is being shown, or which form fields have been validated), can be formally specified. In this sense it contrasts sharply with other web frameworks, whose relative complexity make formal reasoning a practical impossibility.

External links